package tree;

import sun.misc.Queue;

import java.util.LinkedList;

public class Test {
    public static void main(String[] args) {
        BinaryTree<Integer, String> bt = new BinaryTree<>();
        bt.put(10, "二哈");
        bt.put(5, "张三");
        bt.put(11, "李四");
        bt.put(3, "王五2");
        bt.put(7, "王五3");
        bt.put(6, "王五4");
        bt.put(8, "王五4");
        bt.put(9, "王五6");
//        bt.delete(5);
//        LinkedList<Node<Integer, String>> nodes = bt.preErgodic();
        LinkedList<Node<Integer, String>> nodes = bt.layerErgodic();
        nodes.forEach(ele->{
            System.out.println(ele.key+":"+ele.value);
        });

        System.out.println(bt.maxDepth());


    }
}
